<template>
    <a-card :bordered="false">
        散客账务
        <div>


            <a-table ref="table" size="small" bordered rowKey="roomRegisterCode" class="j-table-force-nowrap"
                :scroll="{ y: 250 }" :columns="columns" :dataSource="dataSource" :pagination="ipagination"
                :loading="loading"
                :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }"
                @change="handleTableChange">

                <template slot="htmlSlot" slot-scope="text">
                    <div v-html="text"></div>
                </template>
            </a-table>
            <a-tabs v-model="activeKey" type="card" style="border: solid 1px #e8e8e8;">
                <a-tab-pane v-for="pane in panes" :key="pane.key" :tab="pane.title">
                    <ShouYinChuLi v-if="pane.key === '1'" />
                </a-tab-pane>
            </a-tabs>
        </div>
    </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ShouYinChuLi from './ShouYinChuLi/ShouYinChuLi'

export default {
    name: 'SanKeZhangWu',
    mixins: [JeecgListMixin],
    components: {
        ShouYinChuLi
    },
    data() {
        const panes = [
            { title: '收银处理', key: '1' },
            { title: 'Tab 2', key: '2' },
            { title: 'Tab 3', key: '3' },
        ]
        return {
            panes,
            activeKey: panes[0].key,
            columns: [
                {
                    title: '#',
                    dataIndex: '',
                    key: 'rowIndex',
                    width: 60,
                    align: "center",
                    customRender: function (t, r, index) {
                        return parseInt(index) + 1;
                    }
                },
                {
                    title: '登记编码',
                    align: "center",
                    dataIndex: 'roomRegisterCode',
                    width: 200,
                },
                {
                    title: '房间号',
                    align: "center",
                    dataIndex: 'roomCode',
                    width: 100,
                },
                {
                    title: '抵店时间',
                    align: "center",
                    dataIndex: 'dateArrival',
                    width: 180,
                },
                {
                    title: '预离店时间',
                    align: "center",
                    dataIndex: 'dateDeparture',
                    width: 180,
                },
                {
                    title: '房晚数',
                    align: "center",
                    dataIndex: 'dateNum',
                    width: 100,
                },
                {
                    title: '房价',
                    align: "center",
                    dataIndex: 'roomPrice',
                    width: 100,
                },
                {
                    title: '早餐份数',
                    align: "center",
                    dataIndex: 'breakfastNum',
                    width: 100,
                },
                {
                    title: '客人账号',
                    align: "center",
                    dataIndex: 'accountCode',
                    width: 220,
                },
                {
                    title: '客人姓名',
                    align: "center",
                    dataIndex: 'guestName',
                    width: 220,
                },
                {
                    title: '余额',
                    align: "center",
                    dataIndex: 'amount',
                },
            ],
            url: {
                list: "/room/skAccount/list",
            },
            isorter: {
                column: 'roomRegisterCode',
                order: 'desc',
            },
            ipagination: {
                current: 1,
                pageSize: 5,
                pageSizeOptions: ['5', '10', '20', '30'],
                showTotal: (total, range) => {
                    return range[0] + "-" + range[1] + " 共" + total + "条"
                },
                showQuickJumper: true,
                showSizeChanger: true,
                total: 0
            },
        }
    },
    created() {

    },
    methods: {

    }
}
</script>